package lab02.test36;

public class Test36 {
    public static void main(String[] args) {
        Student [] stu = new Student[5];
        //Student [] stud=new Postgraduate[2];

        stu[0]=new Undergraduate("张三","本科生",90,95,100);
        stu[1]=new Undergraduate("李四","本科生",80,85,90);
        stu[3]=new Undergraduate("赵六","本科生",75,82,87);
        stu[2]=new Postgraduate("王五","研究生",82,85,88);
        stu[4]=new Postgraduate("陈七","研究生",80,82,84);



        System.out.println("姓名"+"\t\t"+" 类型"+"\t\t"+"成绩");

        for (int i=0;i<stu.length;i++) {
            System.out.printf(stu[i].name+"\t\t"+stu[i].sort+"\t\t");
            if (stu[i].sort.equals("本科生")) {
                stu[i].underGrade();
            }else if (stu[i].sort.equals("研究生")) {
                stu[i].postGrade();
            }
        }



    }
}
